//
// Created by xili on 2024/9/1 15:59.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    int busyStudent(vector<int> &startTime, vector<int> &endTime, int queryTime) {
        vector<int> v(1002);
        int n = startTime.size();
        for (int i = 0; i < n; i++) {
            v[startTime[i]]++;
            v[endTime[i] + 1]--;
        }
        for (int i = 1; i < 1002; i++) {
            v[i] += v[i - 1];
        }
        return v[queryTime];
    }
};
